<?php
/**
 * Created by PhpStorm.
 * User: liuchaozhong
 * Date: 2017/8/27
 * Time: 下午7:32
 */

//登录
Route::get('auth/login','LoginController@login');
Route::post('auth/loginPost','LoginController@loginPost');
Route::get('auth/logout','LoginController@logout');


Route::group(['middleware'=> ['admin.auth', 'permission']] ,function(){
    Route::get('/', 'IndexController@index')
        ->name('admin-index-index');
    Route::get('index/welcome', 'IndexController@welcome')
        ->name('admin-index-welcome');

    //管理员控制器 name命名用于识别路由,因为有些路由带参数,不好识别  AdminController
    Route::get('admin/index','AdminController@index')
        ->name('admin-admin-index');
    Route::any('admin/indexPost','AdminController@indexPost')
        ->name('admin-admin-indexPost');
    Route::get('admin/addAdmin','AdminController@addAdmin')
        ->name('admin-admin-addAdmin');
    Route::post('admin/addAdminPost','AdminController@addAdminPost')
        ->name('admin-admin-addAdminPost');
    Route::post('admin/upload','AdminController@upload')
        ->name('admin-admin-upload');
    Route::get('admin/editAdmin/{id}','AdminController@editAdmin')
        ->name('admin-admin-editAdmin');
    Route::post('admin/delAdmin','AdminController@delAdmin')
        ->name('admin-admin-delAdmin');

    //角色控制器 AdminRoleController
    Route::get('role/index','AdminRoleController@index')
        ->name('admin-role-index');
    Route::post('role/indexPost','AdminRoleController@indexPost')
        ->name('admin-role-indexPost');
    Route::get('role/addRole','AdminRoleController@addRole')
        ->name('admin-role-addRole');
    Route::post('role/addRolePost','AdminRoleController@addRolePost')
        ->name('admin-role-addRolePost');
    Route::post('role/delRole','AdminRoleController@delRole')
        ->name('admin-role-delRole');
    Route::get('role/rolePermission/{role_id}','AdminRoleController@rolePermission')
        ->name('admin-role-rolePermission');
    Route::post('role/rolePermissionPost','AdminRoleController@rolePermissionPost')
        ->name('admin-role-rolePermissionPost');

    //权限控制器 AdminPermissionController
    Route::get('permission/index','AdminPermissionController@index')
        ->name('admin-permission-index');
    Route::post('permission/indexPost','AdminPermissionController@indexPost')
        ->name('admin-permission-indexPost');
    Route::get('permission/addPermission','AdminPermissionController@addPermission')
        ->name('admin-permission-addPermission');
    Route::post('permission/addPermissionPost','AdminPermissionController@addPermissionPost')
        ->name('admin-permission-addPermissionPost');
    Route::get('permission/editPermission/{id}','AdminPermissionController@editPermission')
        ->name('admin-permission-editPermission');
    Route::post('permission/delPermissionPost','AdminPermissionController@delPermissionPost')
        ->name('admin-permission-delPermissionPost');

    //动态分类控制器 ArticleCateController
    Route::get('articleCate/index/{id?}','ArticleCateController@index')
        ->name('admin-articleCate-index');
    Route::post('articleCate/indexPost','ArticleCateController@indexPost')
        ->name('admin-articleCate-indexPost');
    Route::get('articleCate/addCate','ArticleCateController@addCate')
        ->name('admin-articleCate-addCate');
    Route::post('articleCate/addCatePost','ArticleCateController@addCatePost')
        ->name('admin-articleCate-addCatePost');
    Route::get('articleCate/editCate/{id}','ArticleCateController@editCate')
        ->name('admin-articleCate-editCate');
    Route::post('articleCate/delCate','ArticleCateController@delCate')
        ->name('admin-articleCate-delCate');

    //动态控制器 ArticleController
    Route::get('article/index','ArticleController@index')
        ->name('admin-article-index');
    Route::post('article/indexPost','ArticleController@indexPost')
        ->name('admin-article-indexPost');
    Route::get('article/addArticle','ArticleController@addArticle')
        ->name('admin-article-addArticle');
    Route::post('article/addArticlePost','ArticleController@addArticlePost')
        ->name('admin-article-addArticlePost');
    Route::get('article/editArticle/{id}','ArticleController@editArticle')
        ->name('admin-article-editArticle');
    Route::post('article/delArticle','ArticleController@delArticle')
        ->name('admin-article-delArticle');

    //用户控制器 MemberController
    Route::get('member/index','MemberController@index')
        ->name('admin-member-index');
    Route::post('member/indexPost','MemberController@indexPost')
        ->name('admin-member-indexPost');
    Route::get('member/addMember','MemberController@addMember')
        ->name('admin-member-addMember');
    Route::post('member/addMemberPost','MemberController@addMemberPost')
        ->name('admin-member-addMemberPost');
    Route::get('member/editMember/{id}','MemberController@editMember')
        ->name('admin-member-editMember');
    Route::post('member/delMember','MemberController@delMember')
        ->name('admin-member-delMember');
    Route::post('member/accessMember','MemberController@accessMember')
        ->name('admin-member-accessMember');

});